{include file="public/header" /}





<div class="page">
    <form id="user_form" method="post">
        <div class="ds-default-table">
            <table>
                <tbody>
                    <tr class="noborder">
                        <td class="required w120">{$Think.lang.ds_member_name}</td>
                        <td class="vatop rowform">
                            <input type="hidden" name="member_id" id="member_id" value="{$member_info.member_id|default='0'}"/>
                            <input id="member_name" name="member_name" value="{$member_info.member_name|default=''}" class="input-txt" type="text" onchange="javascript:checkmember();">
                            <span class="err"></span>
                            <p class="notic"></p>
                        </td>    
                    </tr>
                    <tr class="noborder" id="tr_memberinfo">
                        <td colspan="2" class="required" id="td_memberinfo">
                            {notempty name="member_info"}
                            {$member_info.member_name}, {$Think.lang.now_available_predeposit}{$member_info.available_predeposit}, {$Think.lang.now_freeze_predeposit}{$member_info.freeze_predeposit}
                            {/notempty}
                        </td>
                    </tr>
                    <tr>
                        <td class="required w120">{$Think.lang.admin_predeposit_artificial_operatetype}</td>
                        <td class="vatop rowform">
                            <select id="operatetype" name="operatetype">
                                <option value="1">{$Think.lang.operatetype_1}</option>
                                <option value="2">{$Think.lang.operatetype_2}</option>
                                <option value="3">{$Think.lang.operatetype_3}</option>
                                <option value="4">{$Think.lang.operatetype_4}</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="required w120">{$Think.lang.admin_predeposit_price}</td>
                        <td class="vatop rowform"><input type="text" class="form-control" name="amount" id="amount" value="" /></td>
                    </tr>
                    <tr>
                        <td class="required w120">{$Think.lang.lg_desc}</td>
                        <td class="vatop rowform"><textarea name="lg_desc" ></textarea></td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr class="tfoot">
                        <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </form>
</div>

<script>
                        function checkmember() {
                            var membername = $.trim($("#member_name").val());
                            if (membername == '') {
                                $("#member_id").val('0');
                                layer.alert('{$Think.lang.admin_predeposit_artificial_membernamenull_error}');
                                return false;
                            }
                            var url = ADMINSITEURL + '/Predeposit/checkmember.html';
                            $.post(url, {'name': membername}, function(data) {
                                if (data.id)
                                {
                                    $("#tr_memberinfo").show();
                                    var msg = " " + data.name + ", {$Think.lang.now_available_predeposit}" + data.available_predeposit + ", {$Think.lang.now_freeze_predeposit}" + data.freeze_predeposit;
                                    $("#member_name").val(data.name);
                                    $("#member_id").val(data.id);
                                    $("#td_memberinfo").text(msg);
                                }
                                else
                                {
                                    $("#member_name").val('');
                                    $("#member_id").val('0');
                                    layer.alert("{$Think.lang.admin_predeposit_userrecord_error}");
                                }
                            }, 'json');
                        }
</script>
<script type="text/javascript">
    $(function(){
        $('#user_form').validate({
            errorPlacement: function(error, element) {
                error.appendTo(element.parent().parent().find('td:last'));
            },
            rules: {
                amount :{
                    required: true,
                    number:true,
                    min:0,
                },
                member_id:{
                    required: true,
                }
                
                 
            },
            messages: {
                amount :{
                   required: '{$Think.lang.amount_required}',
                   number: '{$Think.lang.amount_number}',
                   min: '{$Think.lang.amount_min}'
                },    
            }
        });
        
    });
    
    
</script>
</body>